---
title: "Font Family"
description: "Utilities for controlling the font family of an element."
features:
  responsive: true
  customizable: true
  hover: false
  focus: false
---

import plugin from 'tailwindcss/lib/plugins/fontFamily'
import { Variants } from '@/components/Variants'
import { Disabling } from '@/components/Disabling'

export const classes = { plugin }

## Sans-serif

Use `font-sans` to apply a web safe sans-serif font family:

```html lightBlue
<template preview>
  <p class="font-sans text-xl text-light-blue-600 text-center">
    The quick brown fox jumps over the lazy dog.
  </p>
</template>

<p class="**font-sans** ...">
  The quick brown fox jumps over the lazy dog.
</p>
```

## Serif

Use `font-serif` to apply a web safe serif font family:

```html emerald
<template preview>
  <p class="font-serif text-xl text-emerald-600 text-center">
    The quick brown fox jumps over the lazy dog.
  </p>
</template>

<p class="**font-serif** ...">
  The quick brown fox jumps over the lazy dog.
</p>
```

## Monospaced

Use `font-mono` to apply a web safe monospaced font family:

```html indigo
<template preview>
  <p class="font-mono text-xl text-indigo-600 text-center">
    The quick brown fox jumps over the lazy dog.
  </p>
</template>

<p class="**font-mono** ...">
  The quick brown fox jumps over the lazy dog.
</p>
```

## Responsive

To control the font family of an element at a specific breakpoint, add a `{screen}:` prefix to any existing font family utility class. For example, use `md:font-serif` to apply the `font-serif` utility at only medium screen sizes and above.

```html
<p class="font-sans **md:font-serif**">
  <!-- ... -->
</p>
```

For more information about Tailwind's responsive design features, check out the [Responsive Design](/docs/responsive-design) documentation.

## Customizing

### Font Families

By default, Tailwind provides three font family utilities: a cross-browser sans-serif stack, a cross-browser serif stack, and a cross-browser monospaced stack. You can change, add, or remove these by editing the `theme.fontFamily` section of your Tailwind config.

```diff-js
  // tailwind.config.js
  module.exports = {
    theme: {
      fontFamily: {
-       'sans': ['ui-sans-serif', 'system-ui', ...],
-       'serif': ['ui-serif', 'Georgia', ...],
-       'mono': ['ui-monospace', 'SFMono-Regular', ...],
+       'display': ['Oswald', ...],
+       'body': ['"Open Sans"', ...],
      }
    }
  }
```

Font families can be specified as an array or as a simple comma-delimited string:

```js
{
  // Array format:
  'sans': ['Helvetica', 'Arial', 'sans-serif'],

  // Comma-delimited format:
  'sans': 'Helvetica, Arial, sans-serif',
}
```

Note that **Tailwind does not automatically escape font names** for you. If you're using a font that contains an invalid identifier, wrap it in quotes or escape the invalid characters.

```js
{
  // Won't work:
  'sans': ['Exo 2', ...],

  // Add quotes:
  'sans': ['"Exo 2"', ...],

  // ...or escape the space:
  'sans': ['Exo\\ 2', ...],
}

```

### Variants

<Variants plugin="fontFamily" />

### Disabling

<Disabling plugin="fontFamily" />
